
#页面类

from time import sleep

from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    sousuokuang=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
    shurukuang=(By.ID,'com.xiachufang:id/search_edit_text')
    sousobutton=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[3]/android.widget.TextView')
    dy=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[1]/android.widget.LinearLayout/android.widget.TextView[1]')
    def sousuoyewu(self,name):
        self.loc_ele(self.sousuokuang).click()
        sleep(5)
        self.loc_ele(self.shurukuang).send_keys(name)
        sleep(5)
        self.loc_ele(self.sousobutton).click()
        sleep(5)
